<%@page import="java.util.Enumeration"%>
<%@page import="qualomelhor.server.DAO"%>
<%@page import="qualomelhor.database.Email"%>
<%@page import="java.util.Date"%>

<%
	DAO d = new DAO();
	
	Email email = new Email(new String[] {"rodteixo2@yahoo.com.br"}, "QUAL O MELHOR - FB DEAUTHORIZATION", "", "text/plain", new Date());

	String body = "";
	String parameterNames = "";
	for (Enumeration e = request.getParameterNames(); e.hasMoreElements(); ) {
		parameterNames = (String)e.nextElement();
		out.println(parameterNames + ": " + request.getParameter(parameterNames) + "<br/>");
		body += parameterNames + ": " + request.getParameter(parameterNames) + "/r/n";
	}
	email.setBody(body);

	boolean result = d.gravaNovoEmail(email);
	
	if (result) {
		out.println("email gravado!<br/>");
	} else {
		out.println("erro ao gravar o email!<br/>");
	}

%>